package engine.game;

import java.util.Iterator;
import java.util.List;

import engine.game.physicalObjects.concreteObjects.SnowBlobby;

public class Team {
	/* *********************************************************
	 * Attributes
	 * ********************************************************* */
	private List<SnowBlobby> _blobbies;
	private int _touchCount;
	private static int maxTouchAllowed = 3;
	
	/* *********************************************************
	 * Constructor(s)
	 * ********************************************************* */
	public Team(){
		//TODO 
	}
	
	/* *********************************************************
	 * Instance Methods
	 * ********************************************************* */
	private void addATouch(){
		_touchCount++;
		//TODO check is >maxTouchAllowed if yes then notify
	}
	private void resetTouchCount(){
		_touchCount = 0;
	}

	public void refreshPlayersAction() {
		Iterator<SnowBlobby> ite = _blobbies.iterator();
		while(ite.hasNext()){
			ite.next().refreshAction();
		}
	}
	
	protected void onTouchHandler(){
		addATouch();
	}

	public void movePlayers() {
		Iterator<SnowBlobby> ite = _blobbies.iterator();
		while(ite.hasNext()){
			ite.next().makeMove();
		}
	}
	
	public void initializePlayers(int xPosition, int yPosition) {
		Iterator<SnowBlobby> ite = _blobbies.iterator();
		while(ite.hasNext()){
			ite.next().initializePosition(xPosition, yPosition);
		}
	}
	
	public int getHeight(){
		return _blobbies.get(1).getHeight();
	}
}
